package com.example.zhiran.service.resourceservice;

import com.example.zhiran.mapper.TableResourceTagMapper;
import com.example.zhiran.mapper.ZRResourceMapper;
import com.example.zhiran.pojo.orm.ZRResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ZRResourceService {
    @Autowired
    private ZRResourceMapper resourceMapper;

    @Autowired
    private TableResourceTagMapper resourceTagMapper;

    //获得所有resource
    public List<ZRResource> getResources(){
        return resourceMapper.getAllResources();
    }

    //根据tags寻找对应的resource
//    public List<ZRResource> getResourcesByTags(List<String> tags){
//
//    }
    //获得用户的所有上传资源
    public List<ZRResource> getResourcesByUserId(String zrId){
        return resourceMapper.getAllResources();
    }

    //上传资源
    public void insertResource(ZRResource zrResource){
        resourceMapper.insertResource(zrResource);
    }

    //删除资源
    public void deleteResource(String rsId){
        resourceMapper.deleteResource(rsId);
    }
}
